﻿using HECore.Account.Contract;
using HECore.Account.Contract.Models.Account.Dtos;
using HECore.Account.Contract.Models.Account.Inputs;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace HECore.Account.WebApi.Controllers
{
    /// <summary>
    /// 账号
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class AccountController : ControllerBase
    {
        private readonly IAccountService _accountService;
        public AccountController(IAccountService accountService) { _accountService = accountService; }

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("login")]
        public async Task<AccountDto> Login([FromBody] AccountLoginInput input) { return await _accountService.Login(input); }
    }
}
